home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / c / flash-0.4.3.lha / flash-0.4.3 / Lib / matrix.h < prev    next >
C/C++ Source or Header  |  1999-02-21  |  1KB  |  54 lines

  1. /////////////////////////////////////////////////////////////
  2. // Flash Plugin and Player
  3. // Copyright (C) 1998,1999 Olivier Debon
  4. // 
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9. // 
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. // 
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18. // 
  19. ///////////////////////////////////////////////////////////////
  20. #ifndef _MATRIX_H_
  21. #define _MATRIX_H_
  22.  
  23. #ifdef DUMP
  24. #include "bitstream.h"
  25. #endif
  26.  
  27. struct Matrix {
  28.     float a,b,c,d;
  29.     long tx,ty;
  30. public:
  31.     Matrix operator*(Matrix);
  32.     Matrix invert();
  33.     Matrix();
  34.  
  35. #ifdef DUMP
  36.     void dump(BitStream *bs);
  37. #endif
  38.  
  39.     inline
  40.     long Matrix::getX(long x, long y)
  41.     {
  42.         return (long) (x*a+y*b+tx);
  43.     };
  44.  
  45.     inline
  46.     long Matrix::getY(long x, long y)
  47.     {
  48.         return (long) (x*c+y*d+ty);
  49.     };
  50.  
  51. };
  52.  
  53. #endif /* _MATRIX_H_ */
  54.